package com.qfjy.homework.caijirui;
/**
 * 观察者B
 */
public class ObserverB extends Observer {
    public ObserverB(ObservedObject object) {
        this.object=object;
        this.object.attach(this);
    }

    @Override
    public void update() {
        System.out.println("B观察者观察到变化并更新状态："+object.getState()*2);
    }
}
